//
//  MacroHeader.pch
//  XingMei
//
//  Created by 钱金军 on 2019/3/20.
//  Copyright © 2019年 钱金军. All rights reserved.
//

#ifndef MacroHeader_h
#define MacroHeader_h

#define Code                                @"Code"
#define Msg                                 @"Msg"
#define Response                            @"Response"
#define RESULT                              @"result"
#define UserName                            @"username"




#if DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#define debugMethod() NSLog(@"%s",__func__)、
#else
#define NSLog(...)
#define debugMethod()
#endif

/** 宏定义 */
#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)


#define IS_IPhoneX_All ([UIScreen mainScreen].bounds.size.height == 812 || [UIScreen mainScreen].bounds.size.height == 896)




/** 文本颜色 */

#define rgb_51  [UIColor colorWithRed:51.0f/255.0f green:51.0f/255.0f blue:51.0f/255.0f alpha:1.0f]
#define rgb_153  [UIColor colorWithRed:153.0f/255.0f green:153.0f/255.0f blue:153.0f/255.0f alpha:1.0f]
#define rgb_102  [UIColor colorWithRed:102.0f/255.0f green:102.0f/255.0f blue:102.0f/255.0f alpha:1.0f]
//随机色
#define RandomColor    [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1.0f]




#define rgb(a,g,b)          [UIColor colorWithRed:(a)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
#define rgba(r,g,b,a)          [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
/** TabBarColor */
#define TabBarColor  [UIColor colorWithRed:57.0f/255.0f green:134.0f/255.0f blue:250.0f/255.0f alpha:1.0f]
/** 加粗字体 */
#define JIACU                               @"HelveticaNeue-Bold"
/** 第一次登录 */
#define firstLogin                          @"firstLogin"
/** 中等字体 */
#define ZhongDeng                           @"PingFang-SC-Medium"
/** Medium 字体设置 */
#define  MediumFont(a)      [UIFont fontWithName:@"PingFang-SC-Medium" size:a]
/** bold 字体设置 */
#define  BoldFont(a)      [UIFont fontWithName:@"PingFang-SC-Bold" size:a]
/**  字体设置 */
#define  RegularFont(a)      [UIFont fontWithName:@"PingFang-SC-Regular" size:a]



/** 颜色 */
#define REDCOLOR  [UIColor colorWithRed:191.0f/255.0f green:40.0f/255.0f blue:32.0f/255.0f alpha:1.0f]
/** 红色 */
#define REDCOLOR  [UIColor colorWithRed:191.0f/255.0f green:40.0f/255.0f blue:32.0f/255.0f alpha:1.0f]

//浅灰色
#define LIGHTGRAYBACKCOLOR [UIColor colorWithRed:239.0/255.0 green:239.0/255.0 blue:239.0/255.0 alpha:1]



//是否IOS7
#define IOS_7 ( [[UIDevice currentDevice].systemVersion doubleValue] >= 7.0f)
#define IOS_8 ( [[UIDevice currentDevice].systemVersion doubleValue] >= 8.0f)

#define UIColorFromRGBA(rgbValue, alphaValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 blue:((float)(rgbValue & 0x0000FF))/255.0 alpha:alphaValue]

#define CGRectSetX(rect, x) rect = CGRectMake(x, rect.origin.y, rect.size.width, rect.size.height)
#define CGRectSetY(rect, y) rect = CGRectMake(rect.origin.x, y, rect.size.width, rect.size.height)
#define CGRectSetWidth(rect, w) rect = CGRectMake(rect.origin.x, rect.origin.y, w, rect.size.height)
#define CGRectSetHeight(rect, h) rect = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, h)

/** 默认图 */
#define PlaceImg           [UIImage imageNamed:@"head_img_1"]
// NSLocalizedString(key, comment) 本质
// NSlocalizeString 第一个参数是内容,根据第一个参数去对应语言的文件中取对应的字符串，第二个参数将会转化为字符串文件里的注释，可以传nil，也可以传空字符串@""。
#define NSLocalizedString(key, comment) [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]

/** 获取用户信息 */
#define GetInfo [UserDefaults shareInstance]

/** 本地储存 */
#define kUserDefaults [NSUserDefaults standardUserDefaults]
/** 屏幕高度 */
#define KScreenHeight [UIScreen mainScreen].bounds.size.height
/** 屏幕宽度 */
#define KScreenWidth [UIScreen mainScreen].bounds.size.width
// 状态栏高度
#define Height_StatusBar (IS_IPhoneX_All ? 44.f : 20.f)
// 导航栏高度
#define Height_NavBar (IS_IPhoneX_All ? 88.f : 64.f)
// tabBar高度
#define Height_TabBar (IS_IPhoneX_All ? (49.f+34.f) : 49.f)
// home indicator
#define Height_Indicator (IS_IPhoneX_All ? 34.f : 0.f)
/** 比例  **/
#define kscW  (KScreenWidth == 375 ? 1.0f : KScreenWidth/375.0f)
#define kscH  (KScreenHeight== 667 ? 1.0f : KScreenHeight/667.0f)


#endif /* MacroHeader_h */
